﻿using System;
using System.Xml;

namespace Moonlite.Data.EditorInterop
{
    internal static class GenericObjectNodeParser
    {
        internal static void Parse(XmlNode node, IDeserializedObject @object)
        {
            foreach (XmlNode childNode in node.ChildNodes)
            {
                switch (childNode.Name.ToLower())
                {
                    case "aiflag":
                    case "flag":
                        @object.Children.Add(Flag.Parse(childNode));
                        break;
                    case "cameravalue":
                        @object.Children.Add(CameraValue.Parse(childNode));
                        break;
                }
            }
        }
    }
}
